
// MFCD3D11Test.h : main header file for the MFCD3D11Test application
//
#pragma once

#ifndef __AFXWIN_H__
	#error "include 'stdafx.h' before including this file for PCH"
#endif

#include "resource.h"       // main symbols

#include "Project.h"
#include "D3DApp.h"
#include "Utility/MatlabEng.h"
// CMFCD3D11TestApp:
// See MFCD3D11Test.cpp for the implementation of this class
//

#define WM_REFRESHPROJECT (WM_USER + 401)
//show progress for multithreading
#define WM_LOADXYZ_STARTED      (WM_USER + 402)
#define WM_LOADXYZ_PROCESSING	(WM_USER + 403)
#define WM_LOADXYZ_FINISHED		(WM_USER + 404)

#define WM_PROCESSXYZ_STARTED      (WM_USER + 405)
#define WM_PROCESSXYZ_PROCESSING	(WM_USER + 406)
#define WM_PROCESSXYZ_FINISHED		(WM_USER + 407)

#define WM_OUTPUT_DEBUGMSGTHREAD   (WM_USER + 408)

#define WM_PROCESSMULTIXYZ_STARTED      (WM_USER + 409)
#define WM_PROCESSMULTIXYZ_PROCESSING	(WM_USER + 410)
#define WM_PROCESSMULTIXYZ_FINISHED		(WM_USER + 411)

#define WM_NORMALESTUPDATE_STARTED (WM_USER+412)
#define WM_NORMALESTUPDATE_FINISHED (WM_USER+413)

#define WM_RAYTRACINGHMSTAT_STARTED (WM_USER+414)
#define WM_RAYTRACINGHMSTAT_FINISHED (WM_USER+415)

#define WM_RAYTRACINGVGONIO_STARTED (WM_USER+416)
#define WM_RAYTRACINGVGONIO_FINISHED (WM_USER+417)

#define WM_RAYTRACINGVGONIOMFILES_STARTED (WM_USER+418)
#define WM_RAYTRACINGVGONIOMFILES_FINISHED (WM_USER+419)

#define WM_COMPUTEWAVEOPTICBRDFSINGLEXYZ_STARTED (WM_USER+420)
#define WM_COMPUTEWAVEOPTICBRDFSINGLEXYZ_FINISHED (WM_USER+421)

#define WM_COMPUTEWAVEOPTICBRDFMULTIPLEXYZ_STARTED (WM_USER+422)
#define WM_COMPUTEWAVEOPTICBRDFMULTIPLEXYZ_FINISHED (WM_USER+423)


class CMFCD3D11TestApp : public CD3DApp
{
public:
	CMFCD3D11TestApp();


// Overrides
public:
	virtual BOOL InitInstance();
	virtual int ExitInstance();

// Implementation
	UINT  m_nAppLook;
	BOOL  m_bHiColorIcons;

	virtual void PreLoadState();
	virtual void LoadCustomState();
	virtual void SaveCustomState();

	afx_msg void OnAppAbout();
	afx_msg void OnOpenProject();

	virtual BOOL OnIdle(LONG lCount);


	CProject& Project()	{return m_Project;	}
	BOOL OpenDataFile( LPCTSTR s );

	void OutputString(LPCTSTR str);
	CMFCPropertyGridCtrl* GetPropertyGridCtrl();
	CMatlabEng* GetMATLABEngine();
protected:
	afx_msg void OnOutputDbgInfoThread(WPARAM wParam, LPARAM lparam);

private:
	CProject	m_Project;
	CMatlabEng  m_MatlabEngine;

private:
	void RefreshProject();

	DECLARE_MESSAGE_MAP()

};

extern CMFCD3D11TestApp theApp;
extern HWND theMainWnd;
